home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Periodicals / develop / develop Issue 19 / develop 19 code / GX Bitmaps / DrawShapeOffscreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-08  |  1.0 KB  |  49 lines  |  [TEXT/KAHL]

  1. /*
  2. ••••••••••••••••••••
  3.     DrawShapeOffscreen.c
  4.     David Surovell
  5.  
  6.     this file contains 1 routine that demonstrates drawing a shape into a gx offscreen
  7.     (a qdgx library structure) for a single, one-shot instance.
  8. ••••••••••••••••••••
  9. */
  10.  
  11. #include <Types.h>
  12.  
  13. #include "graphics types.h"
  14. #include "graphics errors.h"
  15. #include "graphics routines.h"
  16.  
  17. #include "offscreen library.h"
  18.  
  19.  
  20. void DrawShapeOffscreen(
  21.     offscreen    *offGXWorld,
  22.     gxShape    targetShape );
  23.  
  24.  
  25. void DrawShapeOffscreen(
  26.     offscreen    *offGXWorld,
  27.     gxShape    targetShape )
  28. {
  29. gxTransform    newXform, savedXform;
  30.  
  31.     if ((offGXWorld == nil) || (targetShape == nil))
  32.         return;
  33.     if (offGXWorld->port == nil)
  34.         return;
  35.  
  36.     savedXform = GXGetShapeTransform( targetShape );
  37.     (void)GXCloneTransform( savedXform );
  38.     newXform = GXCopyToTransform( nil, savedXform );
  39.     GXSetTransformViewPorts( newXform, 1L, &(offGXWorld->port) );
  40.     GXSetShapeTransform( targetShape, newXform );
  41.  
  42.     GXDrawShape( targetShape );
  43.  
  44.     GXSetShapeTransform( targetShape, savedXform );
  45.     GXDisposeTransform( newXform );
  46.     GXDisposeTransform( savedXform );
  47. }
  48.  
  49.